﻿@model eBusiness.Models.Product

<fieldset>
    <legend>Product details</legend>
    <table class="dashboardTable">
        <tr>
            <td style="width: 150px; padding: 10px;">
                <img src="@Model.ThumbImage" alt="thumbimage" class="prductDetailThumbImage" />
                <div id="priceDiv">
                    <div>
                        Price:
                    </div>
                    <div>
                        <span class="blueText" style="font-size: 1.7em; font-weight: bold">@Html.DisplayFor(model => model.Price)</span><span>
                            VND</span>
                    </div>
                    @if (Model.IsDiscount)
                    {
                        <div>
                            Discount by Number
                        </div>
                        <div>
                            <span class="redText" style="font-size: 1.3em; font-weight: bold">@Model.DiscountByNumber
                            </span><span>VND</span>
                        </div>
                        <div>
                            Discount by Percent
                        </div>
                        <div class="redText" style="font-size: 1.3em; font-weight: bold">
                            @Model.DiscountByPercent %
                        </div>
                    }
                </div>
                <div class="productDetailsImageDiv">
                    <ul class="nav_common_ul">
                        @if (!string.IsNullOrEmpty(Model.Images))
                        {
                            foreach (var image in Model.Images.Split(':'))
                            {
                                if (!string.IsNullOrEmpty(image))
                                {
                            <li>
                                <img class="productImagesDetailSmall" src="@image" alt="images" />
                            </li>
                                }
                            }
                        }
                    </ul>
                </div>
            </td>
            <td>
                <table class="dashboardTable">
                    <tr>
                        <td colspan="3">
                            <h1 style="color: #5C87B2; font-weight: bold; margin-left: 20px;">@Html.DisplayFor(model => model.Name)</h1>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Categories
                        </td>
                        <td>
                            @foreach (var cat in Model.Categories)
                            {
                                <span>@cat.Name </span>
                                @:,
                                                                                    }
                        </td>
                        <td rowspan="5" class="rightcolProductDetail">
                            <div class="redText" style="font-weight: bold; font-size: 2em">
                                <span>
                                    @Model.QuantityInStock
                                </span>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Code
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.Code)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Color
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.Color)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Size
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.Size)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Type
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.Type)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            MadeFrom
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.MadeFrom)
                        </td>
                        <td rowspan="4" class="rightcolProductDetail">
                            <div style="font-weight: bold; font-size: 1.8em; color: #87B6EE">
                                @Model.Status.Name
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            MadeBy
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.MadeBy)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Manufacture
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.Manufacture)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Warranty
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.Warranty)
                        </td>
                    </tr>                    
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <b>Description</b>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                @Model.Description
            </td>
        </tr>
    </table>
</fieldset>